﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PriceAreasNew.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Tìm Giá Theo Khu Vực </title>
    <script src="assets/js/Admin_002.js" type="text/javascript"></script>
    <script src="assets/js/Admin.js" type="text/javascript"></script>
    <script src="assets/js/Validation.js" type="text/javascript"></script>
    <script src="assets/js/jquery-1.4.2.js" type="text/javascript"></script>
    <%--<script type="text/javascript"
		src="http://code.jquery.com/jquery-1.5.2.min.js"></script>--%>
    <script src="assets/jquery/jquery-ui.min.js" type="text/javascript"></script>
    <script src="assets/jquery/jquery.dialog.extra.js" type="text/javascript"></script>
    <script type='text/javascript' src="assets/js/jquery.bgiframe.min.js"></script>
    <script type='text/javascript' src="assets/js/jquery.ajaxQueue.js"></script>
    <script type='text/javascript' src="assets/js/thickbox-compressed.js"></script>
    <script type='text/javascript' src="assets/js/jquery.autocomplete.js"></script>
    <script type='text/javascript' src="assets/js/Ports.js"></script>
    <script type='text/javascript' src="Assets/js/jquery-custom-1.0.0.js?v=0611"></script>
    <script type='text/javascript' src="Assets/js/zoom.js"></script>
    <script type='text/javascript' src="assets/js/Carrs.js"></script>
    <script type='text/javascript' src="Assets/js/UpdatepriceAreasNew.js"></script>
    <script type='text/javascript' src="Assets/js/encoder.js"></script>
    <script type='text/javascript' src="Assets/jquery/jquery.cookie.js"></script>
    <link href="assets/jquery/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="assets/css/jquery.autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="assets/css/thickbox.css" />
    <link rel="stylesheet" href="assets/css/reset.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/styleexpress.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/invalid.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="Assets/css/EditTableCell.css" type="text/css" />
    <link rel="stylesheet" href="Assets/css/zoom.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="assets/css/datepicker.css" />
    <script type='text/javascript' src="assets/js/jquery.ui.datepicker.js"></script>
    <script type="text/javascript" language="javascript">
        var nPermissions = '<%=nPermissions %>';
        var lPolID = '<%=lPolID %>';
        var lCarrID = '<%=lCarrID %>';
        var lregion = [];
        function getUrlVars() {
            var vars = {};
            var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
                vars[key] = value;
            });
            return vars;
        }
        function doDelete(strID, strName) {
            if (confirm('Bạn có thực sự muốn xóa ' + strName + '?')) {
                var vnpage = getUrlVars()['page_number'];
                if (vnpage)
                    window.location.href = "PriceAreasNew.aspx?action=delete&ID=" + strID + "&page_number=" + vnpage;
                else
                    window.location.href = "PriceAreasNew.aspx?action=delete&ID=" + strID;
            }
        }
        function doPublic(strID, strName) {
            //if (confirm('Bạn có thực sự muốn public ' + strName + '?')) {
            var vnpage = getUrlVars()['page_number'];
            if (vnpage)
                window.location.href = "PriceAreasNew.aspx?action=public&ID=" + strID + "&page_number=" + vnpage;
            else
                window.location.href = "PriceAreasNew.aspx?action=public&ID=" + strID;
            //}
        }
        $().ready(function () {
            $('#txtPol').focus().autocomplete(ports);
            $('#txtCarr').focus().autocomplete(carrs);
            jQuery.ajax({
                type: "POST",
                url: "Handlers/Event.ashx?action=listserviceareacode",
                success: function (msg) {
                    lregion = eval('(' + msg + ')');
                    $("#txtServiceArea").autocomplete(lregion);
                }
            });
            //$("td[code='SerAreaName']").children('input').autocomplete(ports);
            //$("td[code='SerAreaName']").children('input').autocomplete(window[completesource], { matchContains: true, width: 200, max: 200, cacheLength: 200 });           
        });
        function NewLine() {
            var html = "";
            html += "<tr onmouseover=\"this.style.background='#dbf0c9'\" onmouseout=\"this.style.background='#ffffff'\" 	priceid='-1'>";
            html += "<td align=\"center\" title=\"Add New Row\" width=\"28px\" style=\"min-width: 28px; max-width: 28px;overflow: hidden;\">";
            html += "<a href=\"#\" onclick=\"NewLine();\" class=\"newrow\">+</a>";
            html += "</td>";
            html += "<td editable=\"true\" width=\"70px\" style=\"min-width: 70px; max-width: 70px; overflow: hidden;\"	code=\"SerAreaName\" completesource=\"lregion\" title='' class=''>";
            html += "No check";
            html += "</td>";
            html += "<td width=\"50px\" style=\"color: #0000ff; min-width: 50px; max-width: 50px; overflow: hidden;\"	code=\"Carr\">";

            html += "</td>";
            html += "<td editable=\"true\" width=\"250px\" style=\"min-width: 250px; max-width: 250px; overflow: hidden;\" code=\"PodIncluded\" title='' class=''>";
            html += "No check";
            html += "</td>";
            html += "<td width=\"50px\" editable=\"true\" style=\"min-width: 50px; max-width: 50px; overflow: hidden;\" code=\"DC20\" title='' class=''>";
            html += "No check";
            html += "</td>";
            html += "<td width=\"50px\" editable=\"true\" style=\"min-width: 50px; max-width: 50px; overflow: hidden;\" code=\"DC40\" title='' class=''>";
            html += "No check";
            html += "</td>";
            html += "<td width=\"50px\" editable=\"true\" style=\"min-width: 50px; max-width: 50px; overflow: hidden;\" code=\"HC40\" title='' class=''>";
            html += "No check";
            html += "</td>";
            html += "<td width=\"80px\" editable=\"true\" style=\"min-width: 80px; max-width: 80px; overflow: hidden;\" code=\"Validity\" title='' class=''>";
            html += "No check";
            html += "</td>";
            html += "<td width=\"120px\" editable=\"true\" style=\"min-width: 120px; overflow: hidden;\" code=\"Note\" title='' class=''>";
            html += "No check";
            html += "</td>";
            html += "<td width=\"50px\" editable=\"true\" style=\"min-width: 50px; max-width: 50px; overflow: hidden;\"code=\"RF20\" title='' class=''>";
            html += "No check";
            html += "</td>";
            html += "<td width=\"50px\" editable=\"true\" style=\"min-width: 50px; max-width: 50px; overflow: hidden;\" code=\"RF40\" title='' class=''>";
            html += "No check";
            html += "</td>";
            html += "<td width=\"80px\" editable=\"true\" style=\"min-width: 80px; max-width: 80px; overflow: hidden;\" code=\"ValidityEx\" title='' class=''>";
            html += "No check";
            html += "</td>";
            html += "<td width=\"120px\" editable=\"true\" style=\"min-width: 120px; overflow: hidden;\" code=\"NoteEx\"	title='' class=''>";
            html += "No check";
            html += "</td>";
            html += "<td width=\"50px\" style=\"color: #0000ff; min-width: 50px; max-width: 50px; overflow: hidden;\" 	code=\"update\">";

            html += "</td>";

            html += "<td align=\"center\">";

            html += "</td>";

            html += "</tr>";


            $("#trshowmore").before(html);
            $("#trshowmore").hide();
        }

        //        $(".tr_clone_add").live('click', CloneRow);

        //        function CloneRow() {
        //            $(this).closest('.tr_clone').clone().insertAfter(".tr_clone:last");
        //        }
    </script>
    <style type="text/css">
        .newrow
        {
            font-weight: bold;
            color: Red;
            font-size: 14px;
        }
        .groupheader
        {
            background: #efefef !important;
            text-transform: uppercase;
            text-align: center;
        }
        
        .groupheader td
        {
            text-align: center;
            font-weight: bold;
        }
        input[type=text]
        {
            border-radius: 7px;
            border: none;
            line-height: 22px;
            margin: 5px;
        }
    </style>
</head>
<body>
    <div id="body-wrapper">
        <div id="header">
            <!--#include virtual="include/top.ascx"-->
        </div>
        <div id="main-content1">
            <h2>
                PRICE AREAS
            </h2>
            <div class="clear">
            </div>
            <div class="content-box">
                <form id="frmPriceAreas" runat="server" autocomplete="off">
                <div zoomable="true">
                    <div style="height: auto; padding-top: 7px;">
                        <span style="background: #e5e5e5 url('/assets/images/bg-content-box.gif') top left repeat-x;
                            padding: 10px; border-radius: 7px; margin-right: 20px;">
                            <asp:TextBox ID="txtCarr" runat="server" placeholder="CARR"></asp:TextBox>
                            <%-- <asp:DropDownList ID="ddCarr" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddCarr_SelectedIndexChanged">
                            </asp:DropDownList>--%>
                            <asp:TextBox ID="txtPol" runat="server" placeholder="POL"></asp:TextBox>
                            <%-- <asp:DropDownList ID="ddPol" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddPol_SelectedIndexChanged">
                            </asp:DropDownList>--%>
                            <asp:TextBox ID="txtServiceArea" runat="server" placeholder="SER AREA"></asp:TextBox>
                            <asp:Button ID="btnSearh" Text="Search" runat="server" OnClick="btnSearch_Click"
                                CssClass="button" />
                        </span>
                        <input type="button" style="float: right; margin-left: 10px;" class="button" value="Edit"
                            id="btnsave" runat="server" />
                        <div class="clear">
                        </div>
                        <asp:Label ID="lblerror" CssClass="msg-error" runat="server" Style="display: inline-block;
                            margin: 5px;"></asp:Label><br />
                    </div>
                    <div class="content-box-header">
                        <h3>
                            <%=strInforServiceAreas %>
                        </h3>
                        <div style="padding-left: 5px; padding-top: 5px;">
                        </div>
                    </div>
                    <div class="clear">
                    </div>
                    <div autofit="true" style="">
                        <div id="divContent">
                            <fieldset>
                                <asp:Repeater ID="rptData" runat="server">
                                    <ItemTemplate>
                                        <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'"
                                            priceid='<%#Eval("ID") %>' class="tr_clone">
                                            <td align="center" title="Index" width="28px" style="min-width: 28px; max-width: 28px;
                                                overflow: hidden;">
                                                <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                            </td>
                                            <td editable="true" width="70px" style="min-width: 70px; max-width: 70px; overflow: hidden;"
                                                code="SerAreaName" completesource="lregion" title='<%#GetCellTitle(Eval("DC20")) %>'
                                                class='<%#GetCellClass(Eval("DC20"))%>'>
                                                <%#GetCellValue(DataBinder.Eval(Container.DataItem, "SerAreaName"))%>
                                            </td>
                                            <td width="50px" style="color: #0000ff; min-width: 50px; max-width: 50px; overflow: hidden;"
                                                code="Carr">
                                                <%#DataBinder.Eval(Container.DataItem, "Carr")%>
                                            </td>
                                            <td editable="true" width="250px" style="min-width: 250px; max-width: 250px; overflow: hidden;"
                                                code="PodIncluded" title='<%#GetCellTitle(Eval("PodIncluded")) %>' class='<%#GetCellClass(Eval("PodIncluded"))%>'>
                                                <%#GetCellValue(DataBinder.Eval(Container.DataItem, "PodIncluded"))%>
                                            </td>
                                            <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                                code="DC20" title='<%#GetCellTitle(Eval("DC20")) %>' class='<%#GetCellClass(Eval("DC20"))%>'>
                                                <%#GetCellValue(DataBinder.Eval(Container.DataItem, "DC20"))%>
                                            </td>
                                            <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                                code="DC40" title='<%#GetCellTitle(Eval("DC40")) %>' class='<%#GetCellClass(Eval("DC40"))%>'>
                                                <%# GetCellValue(DataBinder.Eval(Container.DataItem, "DC40"))%>
                                            </td>
                                            <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                                code="HC40" title='<%#GetCellTitle(Eval("HC40")) %>' class='<%#GetCellClass(Eval("HC40"))%>'>
                                                <%# GetCellValue(DataBinder.Eval(Container.DataItem, "HC40"))%>
                                            </td>
                                            <td width="80px" editable="true" style="min-width: 80px; max-width: 80px; overflow: hidden;"
                                                code="Validity" title='<%#GetCellTitle(Eval("Validity")) %>' class='<%#GetCellClass(Eval("Validity"))%>'>
                                                <%# GetCellValue(DataBinder.Eval(Container.DataItem, "Validity"))%>
                                            </td>
                                            <td width="120px" editable="true" style="min-width: 120px; overflow: hidden;" code="Note"
                                                title='<%#GetCellTitle(Eval("Note")) %>' class='<%#GetCellClass(Eval("Note"))%>'>
                                                <%# GetCellValue(DataBinder.Eval(Container.DataItem, "Note"))%>
                                            </td>
                                            <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                                code="RF20" title='<%#GetCellTitle(Eval("RF20")) %>' class='<%#GetCellClass(Eval("RF20"))%>'>
                                                <%#GetCellValue( DataBinder.Eval(Container.DataItem, "RF20"))%>
                                            </td>
                                            <td width="50px" editable="true" style="min-width: 50px; max-width: 50px; overflow: hidden;"
                                                code="RF40" title='<%#GetCellTitle(Eval("RF40")) %>' class='<%#GetCellClass(Eval("RF40"))%>'>
                                                <%# GetCellValue(DataBinder.Eval(Container.DataItem, "RF40"))%>
                                            </td>
                                            <td width="80px" editable="true" style="min-width: 80px; max-width: 80px; overflow: hidden;"
                                                code="ValidityEx" title='<%#GetCellTitle(Eval("ValidityEx")) %>' class='<%#GetCellClass(Eval("ValidityEx"))%>'>
                                                <%# GetCellValue(DataBinder.Eval(Container.DataItem, "ValidityEx"))%>
                                            </td>
                                            <td width="120px" editable="true" style="min-width: 120px; overflow: hidden;" code="NoteEx"
                                                title='<%#GetCellTitle(Eval("NoteEx")) %>' class='<%#GetCellClass(Eval("NoteEx"))%>'>
                                                <%# GetCellValue(DataBinder.Eval(Container.DataItem, "NoteEx"))%>
                                            </td>
                                            <td width="50px" style="color: #0000ff; min-width: 50px; max-width: 50px; overflow: hidden;"
                                                code="update">
                                                <%#DataBinder.Eval(Container.DataItem, "LastUpdate")%>
                                            </td>
                                            <%if ((Session["PriceAreasNew"] != null) && (int.Parse(Session["PriceAreasNew"].ToString()) >= 3))
                                                  {%>
                                            <td align="center">
                                                <%# DataBinder.Eval(Container.DataItem, "Action")%>
                                            </td>
                                            <%} %>
                                        </tr>
                                    </ItemTemplate>
                                    <HeaderTemplate>
                                        <div autofit="true" style="">
                                            <table editcellcontent="true" cellspacing="0" cellpadding="0" width="auto" border="0"
                                                class="adminlist" resizeable="true">
                                                <thead>
                                                    <tr>
                                                        <th rowspan="2" align="center">
                                                            INDEX
                                                        </th>
                                                        <th rowspan="2" align="center" class="resizeable">
                                                            SER AREA
                                                        </th>
                                                        <th>
                                                            CARR
                                                        </th>
                                                        <th align="center" class="resizeable unviewable" code="POD">
                                                            POD INCLUDED
                                                        </th>
                                                        <th align="center" class="resizeable unviewable" code="DC20">
                                                            DC20
                                                        </th>
                                                        <th align="center" class="resizeable unviewable" code="DC40">
                                                            DC40
                                                        </th>
                                                        <th class="resizeable unviewable" code="HC40">
                                                            HC40
                                                        </th>
                                                        <th class="resizeable unviewable" code="Validity">
                                                            VALIDITY
                                                        </th>
                                                        <th class="resizeable unviewable" code="Note">
                                                            NOTE
                                                        </th>
                                                        <th align="center" class="resizeable unviewable" code="RF20">
                                                            RF20
                                                        </th>
                                                        <th align="center" class="resizeable unviewable" code="RF40">
                                                            RF40
                                                        </th>
                                                        <th class="resizeable unviewable" code="ValidityEx">
                                                            VALIDITY
                                                        </th>
                                                        <th class="resizeable unviewable" code="NoteEx">
                                                            NOTE
                                                        </th>
                                                        <th align="center" code="update">
                                                            UPDATE
                                                        </th>
                                                        <%if ((Session["PriceAreasNew"] != null) && (int.Parse(Session["PriceAreasNew"].ToString()) >= 3))
                                                              {%>
                                                        <th align="center" width="100px">
                                                            ACTION
                                                        </th>
                                                        <%} %>
                                                    </tr>
                                                </thead>
                                    </HeaderTemplate>
                                    <FooterTemplate>
                                        <tr id="trshowmore" style="dispalay: none;">
                                            <td colspan="23" style="text-align: center;">
                                            </td>
                                        </tr>
                                        </TABLE> </div>
                                    </FooterTemplate>
                                </asp:Repeater>
                            </fieldset>
                        </div>
                        <div class="clear">
                        </div>
                        <div id="footer">
                            <%=strPager%>
                        </div>
                    </div>
                </div>
                </form>
            </div>
        </div>
    </div>
    <span id="ruler" style="visibility: hiddens; white-space: nowrap"></span>
</body>
</html>
